package com.situ.feemanagement.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.situ.feemanagement.mapper.MedicineMapper;
import com.situ.feemanagement.pojo.Medicine;
import org.springframework.beans.factory.annotation.Autowired;

public class MedicineExcelListener extends AnalysisEventListener<Medicine> {

    @Autowired
    private MedicineMapper medicineMapper;

    @Override
    public void invoke(Medicine medicine, AnalysisContext analysisContext) {
        System.out.println("MedicineExcelListener.invoke");
        System.out.println(medicine);
        medicineMapper.addExcel(medicine);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println("MedicineExcelListener.doAfterAllAnalysed");
    }
}
